import http from '../util/http.js'

const queryAllUrl = '/product/queryAll'
const removeByIdUrl = '/product/removeById'
const queryByAccountUrl = '/product/queryByAccount'
const createUrl = '/product/create'
const queryByIdUrl = '/product/queryById'
const modifyUrl = '/product/modify'
const queryByKidUrl= 'product/queryByKid'


const queryAll = (data) => {
    return http.get(queryAllUrl, data)
}

const removeById = (data) => {
    return http.del(removeByIdUrl, data)
}

const queryByAccount = (data) => {
    return http.get(queryByAccountUrl, data)
}

const create = (data) => {
    return http.post(createUrl, data, 'multipart/form-data')
}

const queryById = (data) => {
    return http.get(queryByIdUrl, data)
}

const modify = (data) => {
    return http.put(modifyUrl, data, 'multipart/form-data')
}

const queryByKid = (data) => {
    return http.get(queryByKidUrl, data)
}

export default {
     queryAll, removeById, queryByAccount, create, queryById, modify,queryByKid
}